<template>
	<view>
		<u-navbar title="维修记录"  back-icon-color="#fff"
			:background="{backgroundImage: 'linear-gradient(45deg, #68dae7, #21a4b3)'}" title-color="#FFFFFF">
		</u-navbar>
		<xt-list :list="maintenanceList" @goinfo="gotoInfo"></xt-list>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				deviceId:null,
				maintenanceList:[]
			}
		},
		onLoad(options) {
			this.deviceId = options.deviceSn
			this.getData()
		},
		onPullDownRefresh() {
			this.maintenanceList = []
			this.getData()
		},
		methods:{
			getData(){
				let params = {
					deviceId: this.deviceId
				}
				this.$xt.api.repairList(params).then(res=>{
					this.maintenanceList = res.rows
				})
			},
			gotoInfo(id){
				this.$u.route({
					url: "pages/home/maintenanceInfo",
					type:"navigateTo",
					params:{
						id:id
					}
				})
			}
		}
		
	}
</script>

<style>
</style>